using System;
using System.Windows;

namespace Supremacy.Updater
{
    public static class UpdaterSettings
    {
        #region CheckForUpdatesOnStartup Attached Property
        public static readonly DependencyProperty CheckForUpdatesOnStartupProperty = DependencyProperty.RegisterAttached(
            "CheckForUpdatesOnStartup",
            typeof(bool),
            typeof(UpdaterSettings),
            new FrameworkPropertyMetadata(
                true,
                FrameworkPropertyMetadataOptions.None));

        [AttachedPropertyBrowsableForType(typeof(DependencyObject))]
        public static bool GetCheckForUpdatesOnStartup(DependencyObject source)
        {
            if (source == null)
                throw new ArgumentNullException("source");
            return (bool)source.GetValue(CheckForUpdatesOnStartupProperty);
        }

        public static void SetCheckForUpdatesOnStartup(DependencyObject source, bool value)
        {
            if (source == null)
                throw new ArgumentNullException("source");
            source.SetValue(CheckForUpdatesOnStartupProperty, value);
        }
        #endregion
    }
}